<app-back-btn></app-back-btn>
<div class="page-title">
  <span class="title" *ngIf="!code">添加矿机</span>
  <span class="title" *ngIf="code">修改矿机</span>
</div>

<div class="panel panel-body">
  <form nz-form [formGroup]="validateForm" class="form-wrap" (submit)="addMinerItem($event)">
    <h2 class="subtitle">矿机信息</h2>

    <!--price start-->
    <nz-form-item>
      <nz-form-label [nzSm]="7" nzFor="price" nzRequired> 价格</nz-form-label>
      <nz-form-control [nzSm]="10" [nzValidateStatus]="getFormControl('price')">
        <input nz-input formControlName="price" type="number" id="price" placeholder="价格">
        <nz-form-explain *ngIf="getFormControl('price').dirty&&getFormControl('price').errors">
          <ng-container *ngIf="getFormControl('price').hasError('required')">请输入价格</ng-container>
        </nz-form-explain>
      </nz-form-control>
      <nz-form-control [nzSm]="7" class="font12 pl color-gray">
        价格
      </nz-form-control>
    </nz-form-item>

    <!--dailyIncome start-->
    <nz-form-item>
      <nz-form-label [nzSm]="7" nzFor="dailyIncome" nzRequired> 日收益</nz-form-label>
      <nz-form-control [nzSm]="10" [nzValidateStatus]="getFormControl('dailyIncome')">
        <input nz-input formControlName="dailyIncome" type="number" id="dailyIncome" placeholder="日收益">
        <nz-form-explain *ngIf="getFormControl('dailyIncome').dirty&&getFormControl('dailyIncome').errors">
          <ng-container *ngIf="getFormControl('dailyIncome').hasError('required')">请输入日收益</ng-container>
        </nz-form-explain>
      </nz-form-control>
      <nz-form-control [nzSm]="7" class="font12 pl color-gray">
        日收益
      </nz-form-control>
    </nz-form-item>

    <!--power start-->
    <nz-form-item>
      <nz-form-label [nzSm]="7" nzFor="power" nzRequired> 算力</nz-form-label>
      <nz-form-control [nzSm]="10" [nzValidateStatus]="getFormControl('power')">
        <input nz-input formControlName="power" type="text" id="power" placeholder="算力">
        <nz-form-explain *ngIf="getFormControl('power').dirty&&getFormControl('power').errors">
          <ng-container *ngIf="getFormControl('power').hasError('required')">请输入算力</ng-container>
        </nz-form-explain>
      </nz-form-control>
      <nz-form-control [nzSm]="7" class="font12 pl color-gray">
        算力
      </nz-form-control>
    </nz-form-item>

    <!--upperLimit start-->
    <nz-form-item>
      <nz-form-label [nzSm]="7" nzFor="upperLimit" nzRequired> 挖矿上限</nz-form-label>
      <nz-form-control [nzSm]="10" [nzValidateStatus]="getFormControl('upperLimit')">
        <input nz-input formControlName="upperLimit" type="number" id="upperLimit" placeholder="挖矿上限">
        <nz-form-explain *ngIf="getFormControl('upperLimit').dirty&&getFormControl('upperLimit').errors">
          <ng-container *ngIf="getFormControl('upperLimit').hasError('required')">请输入挖矿上限</ng-container>
        </nz-form-explain>
      </nz-form-control>
      <nz-form-control [nzSm]="7" class="font12 pl color-gray">
        挖矿上限
      </nz-form-control>
    </nz-form-item>

    <!--multiple start-->
    <nz-form-item>
      <nz-form-label [nzSm]="7" nzFor="multiple" nzRequired> 上限倍数</nz-form-label>
      <nz-form-control [nzSm]="10" [nzValidateStatus]="getFormControl('multiple')">
        <input nz-input formControlName="multiple" type="number" id="multiple" placeholder="上限倍数">
        <nz-form-explain *ngIf="getFormControl('multiple').dirty&&getFormControl('multiple').errors">
          <ng-container *ngIf="getFormControl('multiple').hasError('required')">请输入上限倍数</ng-container>
        </nz-form-explain>
      </nz-form-control>
    </nz-form-item>

    <h4 class="subtitle ml-20">金兰宝单买</h4>
    <!--金兰宝单买价格 start-->
    <nz-form-item>
      <nz-form-label [nzSm]="7" nzFor="jlb" nzRequired>金兰宝单买价格</nz-form-label>
      <nz-form-control [nzSm]="10" [nzValidateStatus]="getFormControl('jlb')">
        <input nz-input formControlName="jlb" type="number" id="jlb" placeholder="金兰宝单买价格">
        <nz-form-explain *ngIf="getFormControl('jlb').dirty&&getFormControl('jlb').errors">
          <ng-container *ngIf="getFormControl('jlb').hasError('required')">请输入金兰宝单买价格</ng-container>
        </nz-form-explain>
      </nz-form-control>
      <nz-form-control [nzSm]="7" class="font12 pl color-gray">
        金兰宝+激活币
      </nz-form-control>
    </nz-form-item>

    <!--金兰宝单买价格 start-->
    <nz-form-item>
      <nz-form-label [nzSm]="7" nzFor="active" nzRequired>金兰宝单买激活币价格</nz-form-label>
      <nz-form-control [nzSm]="10" [nzValidateStatus]="getFormControl('active')">
        <input nz-input formControlName="active" type="number" id="active" placeholder="金兰宝单买激活币价格">
        <nz-form-explain *ngIf="getFormControl('active').dirty&&getFormControl('active').errors">
          <ng-container *ngIf="getFormControl('active').hasError('required')">请输入金兰宝单买激活币价格</ng-container>
        </nz-form-explain>
      </nz-form-control>
      <nz-form-control [nzSm]="7" class="font12 pl color-gray">
        金兰宝+激活币
      </nz-form-control>
    </nz-form-item>

    <h4 class="subtitle ml-20">金兰宝+矿石混合买</h4>
    <!--混合买金兰宝价格 start-->
    <nz-form-item>
      <nz-form-label [nzSm]="7" nzFor="mixJlb" nzRequired>混合买金兰宝价格</nz-form-label>
      <nz-form-control [nzSm]="10" [nzValidateStatus]="getFormControl('mixJlb')">
        <input nz-input formControlName="mixJlb" type="number" id="mixJlb" placeholder="混合买金兰宝价格">
        <nz-form-explain *ngIf="getFormControl('mixJlb').dirty&&getFormControl('mixJlb').errors">
          <ng-container *ngIf="getFormControl('mixJlb').hasError('required')">请输入混合买金兰宝价格</ng-container>
        </nz-form-explain>
      </nz-form-control>
      <nz-form-control [nzSm]="7" class="font12 pl color-gray">
        金兰宝+矿石+激活币
      </nz-form-control>
    </nz-form-item>

    <!--混合买矿石价格 start-->
    <nz-form-item>
      <nz-form-label [nzSm]="7" nzFor="mixOre" nzRequired> 混合买矿石价格</nz-form-label>
      <nz-form-control [nzSm]="10" [nzValidateStatus]="getFormControl('mixOre')">
        <input nz-input formControlName="mixOre" type="number" id="mixOre" placeholder="混合买矿石价格">
        <nz-form-explain *ngIf="getFormControl('mixOre').dirty&&getFormControl('mixOre').errors">
          <ng-container *ngIf="getFormControl('mixOre').hasError('required')">请输入混合买矿石价格</ng-container>
        </nz-form-explain>
      </nz-form-control>
      <nz-form-control [nzSm]="7" class="font12 pl color-gray">
        金兰宝+矿石+激活币
      </nz-form-control>
    </nz-form-item>

    <!--混合买激活币价格 start-->
    <nz-form-item>
      <nz-form-label [nzSm]="7" nzFor="mixActive" nzRequired> 混合买激活币价格</nz-form-label>
      <nz-form-control [nzSm]="10" [nzValidateStatus]="getFormControl('mixActive')">
        <input nz-input formControlName="mixActive" type="number" id="mixActive" placeholder="混合买激活币价格">
        <nz-form-explain *ngIf="getFormControl('mixActive').dirty&&getFormControl('mixActive').errors">
          <ng-container *ngIf="getFormControl('mixActive').hasError('required')">请输入混合买激活币价格</ng-container>
        </nz-form-explain>
      </nz-form-control>
      <nz-form-control [nzSm]="7" class="font12 pl color-gray">
        金兰宝+矿石+激活币
      </nz-form-control>
    </nz-form-item>

    <!--库存 start-->
    <nz-form-item>
      <nz-form-label [nzSm]="7" nzFor="inventory" nzRequired>库存</nz-form-label>
      <nz-form-control [nzSm]="10" [nzValidateStatus]="getFormControl('inventory')">
        <input nz-input formControlName="inventory" type="number" id="inventory" placeholder="库存">
        <nz-form-explain *ngIf="getFormControl('inventory').dirty&&getFormControl('inventory').errors">
          <ng-container *ngIf="getFormControl('inventory').hasError('required')">请输入库存</ng-container>
        </nz-form-explain>
      </nz-form-control>
    </nz-form-item>

    <!--商城分割量 start-->
    <nz-form-item>
      <nz-form-label [nzSm]="7" nzFor="separateLimit" nzRequired>商城分割量</nz-form-label>
      <nz-form-control [nzSm]="10" [nzValidateStatus]="getFormControl('separateLimit')">
        <input nz-input formControlName="separateLimit" type="number" id="separateLimit" placeholder="商城分割量">
        <nz-form-explain *ngIf="getFormControl('separateLimit').dirty&&getFormControl('separateLimit').errors">
          <ng-container *ngIf="getFormControl('separateLimit').hasError('required')">请输入商城分割量</ng-container>
        </nz-form-explain>
      </nz-form-control>
    </nz-form-item>

    <!--是否需要激活币 start-->
    <nz-form-item>
      <nz-form-label [nzSm]="7" nzFor="isActiveCoin" nzRequired>是否需要激活币</nz-form-label>
      <nz-form-control [nzSm]="10" [nzValidateStatus]="getFormControl('mixOre')">
        <nz-radio-group formControlName="isActiveCoin">
          <label nz-radio nzValue="Y">是</label>
          <label nz-radio nzValue="N">否</label>
        </nz-radio-group>
      </nz-form-control>
    </nz-form-item>



    <!--表单底部start-->
    <nz-form-item class="action-button">
      <nz-form-control class="text-center">
        <button nz-button [nzType]="'primary'" type="submit" class="pl-30 pr-30" [nzLoading]="isConfirmLoading">
          确定
        </button>
      </nz-form-control>
    </nz-form-item>
    <!--表单底部end-->
  </form>

</div>
